import { defineStore } from 'pinia';

type LoginStatus = 'NOT_LOGIN' | 'LOGINING' | 'LOGINED';

/**
 * 登陆状态
 */
export const useLoginStore = defineStore('login', {
  state: () => {
    return {
      loginStatus: 'NOT_LOGIN',
    };
  },
  getters: {
    isLogin(state) {
      return state.loginStatus === 'LOGINED';
    },
  },
});

/**
 * 用户基本信息
 */
export const useUserInfoStore = defineStore('userInfo', {
  state: () => {
    return {
      aigcPrivacyAccepted: '',
      email: '',
      oneidPrivacyAccepted: '',
      photo: '',
      username: '',
      phone: '', // 手机号
      phone_exist: false,
    };
  },
});
